﻿@using SCMS.Resources
@model IEnumerable<SCMS.UI.Models.ViewGRN>
<div class="partialViewCard">
    <div class="partialViewCardHeader">
        <h3>@Resources_frank.GoodsReceivedNote_LoadGRNVerifyItems_Header</h3>
    </div>
    <br />
    @if (Model.Count() > 0)
    {
        <div id="tablewrapper">
            <table width="98%" align="center" cellpadding="0" cellspacing="0" border="0" id="table"
                class="tinytable">
                <thead>
                    <tr>
                        <th>
                            <h3>
                                @Resources_frank.Global_String_GRNNo</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_frank.Global_String_PONo</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_frank.Global_String_Supplier</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_frank.GoodsReceivedNote_LoadGRNVerifyItems_DestinationOffice</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_frank.GoodsReceivedNote_LoadGRNVerifyItems_DeliveryDate</h3>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr onclick="sendRequest('/GoodsReceivedNote/VerifyGRN/@item.EntityGRN.Id', 'ContentDiv', 'loading')" style=" cursor:pointer;">
                            <td>
                                @item.EntityGRN.RefNumber
                            </td>
                            <td align="center">
                                @item.EntityGRN.GoodsReceivedNoteItems.ToList()[0].PurchaseOrderItem.PurchaseOrder.RefNumber
                            </td>
                            <td>
                                @item.EntityGRN.Supplier.Name
                            </td>
                            <td align="left">
                                @item.EntityGRN.CountrySubOffice.Name
                            </td>
                            <td>@item.EntityGRN.DeliverDate.Value.ToShortDateString()
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    }
    &nbsp;&nbsp;&nbsp;
    @if (Model.Count() < 1)
    {
        <i style="text-align: center;">@Resources_frank.GoodsReceivedNote_LoadGRNVerifyItems_NoGRNs</i>
    }
    <br />
</div>
